/*
 *  Copyright 2005 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.model.core.statistics;

/**
 * <p>Describes some search engine.</p>
 * <p>Pattern is a substring which presence in hostname indicates that this is
 * a given search engine. Var is name of parameter that contains a search query.
 * </p>
 * <p>
 * Subvar is name of parameter that contains a query string used when a query
 * was made. If <b>var</b> is not present, then it's tried to be extracted from
 * <b>subvar</b> value. Subvar encoding is encoding which is used to encode
 * values stored in this query string (default is UTF-8).</p>
 * <p><a href="SearchEngineDescription.java.html"><i>View source</i></a></p>
 *
 * @author Roman Puchkovskiy <a href="mailto:roman.puchkovskiy@blandware.com">
 *         &lt;roman.puchkovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.3 $ $Date: 2006/08/20 14:39:42 $
 */
public class SearchEngineDescription {

    protected Integer id;
    protected String title;
    protected String iconFile;
    protected String pattern;
    protected String var;
    protected String queryEncoding;
    protected String subvar;
    protected String subvarEncoding;

    /**
     * Default constructor.
     */
    public SearchEngineDescription() {
        id = null;
        title = null;
        iconFile = null;
        pattern = null;
        var = null;
        subvar = null;
        subvarEncoding = null;
    }

    /**
     * Returns ID.
     *
     * @return ID
     */
    public Integer getId() {
        return id;
    }

    /**
     * Sets ID.
     *
     * @param id ID to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * Sets id (as string).
     *
     * @param identifier string to set
     */
    public void setIdentifier(String identifier) {
        id = Integer.valueOf(identifier);
    }

    /**
     * Returns title.
     *
     * @return title
     */
    public String getTitle() {
        return title;
    }

    /**
     * Sets title
     *
     * @param title title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Returns icon file name.
     *
     * @return icon file name
     */
    public String getIconFile() {
        return iconFile;
    }

    /**
     * Sets icon file name.
     *
     * @param iconFile file name to set
     */
    public void setIconFile(String iconFile) {
        this.iconFile = iconFile;
    }

    /**
     * Returns pattern by which search engine will be determined.
     *
     * @return pattern
     */
    public String getPattern() {
        return pattern;
    }

    /**
     * Sets pattern by which search engine will be determined.
     *
     * @param pattern pattern to set
     */
    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    /**
     * Returns name of query parameter that contains search query.
     *
     * @return query parameter name
     */
    public String getVar() {
        return var;
    }

    /**
     * Sets name of query parameter that contains search query.
     *
     * @param var name to set
     */
    public void setVar(String var) {
        this.var = var;
    }

    /**
     * Returns query encoding.
     *
     * @return query encoding
     */
    public String getQueryEncoding() {
        return queryEncoding;
    }

    /**
     * Sets query encoding.
     *
     * @param queryEncoding encoding to set
     */
    public void setQueryEncoding(String queryEncoding) {
        this.queryEncoding = queryEncoding;
    }

    /**
     * Returns name of query parameter that contains query string.
     *
     * @return parameter name
     */
    public String getSubvar() {
        return subvar;
    }

    /**
     * Sets name of query parameter that contains query string.
     *
     * @param subvar var name to set
     */
    public void setSubvar(String subvar) {
        this.subvar = subvar;
    }

    /**
     * Returns encoding used to encode query string stored in subvar.
     *
     * @return encoding
     */
    public String getSubvarEncoding() {
        return subvarEncoding;
    }

    /**
     * Sets encoding used to encode query string stored in subvar.
     *
     * @param subvarEncoding encoding to set
     */
    public void setSubvarEncoding(String subvarEncoding) {
        this.subvarEncoding = subvarEncoding;
    }
}
